package com.zsummer.zero.quartz;

import java.util.concurrent.TimeUnit;

import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * 默认为并行任务
 * 添加 DisallowConcurrentExecution 注解串行执行
 * @author zhouyujiang
 *
 */
@DisallowConcurrentExecution
public class AJob implements Job {
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		try {
			TimeUnit.SECONDS.sleep(5);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println(this);
	}
}